<?php echo $this->headLink()->appendStylesheet('/css/search.css') ?>
<div id="global">
	<?php require_once '/template/left-sidebar.phtml';?>
	<div id="content-with-twoside">
		<div class="global-border">
			<h1><span><?php echo $this->escape($this->title);?></span></h1>
			<div class="global-content">
				<table id='tblSrhUser'>
					<tr>
						<td></td>
						<td>用戶名稱</td>
						<td>用戶評分</td>
						<td>將會去的地方</td>
						<td>出發日期</td>
					</tr>
					<?php 
					$calendar_mapper = new Application_Model_CalendarEventsMapper();
					for($i=0; $i<sizeof($this->mbmEntries); $i++) {
						$calendarEntry = $calendar_mapper->findByMemberIdDate($this->mbmEntries[$i]->member_id, $this->year, $this->month, $this->day);
					?>	
					<tr>
						<td><img height="20px" src="<?php echo $this->mbmEntries[$i]->image;?>"/></td>
						<td><a href="<?php echo $this->action . $this->mbmEntries[$i]->member_id;?>"><?php echo $this->mbmEntries[$i]->username;?></a></td>
						<td><?php echo $this->mbmEntries[$i]->deal_credit;?></td>
						<td><?php if($calendarEntry[0]->event_title == ""){echo "沒有行事曆";}else{echo $calendarEntry[0]->event_title;}?></td>
						<td>
						<?php 
							if($calendarEntry[0]->event_title == ""){
								echo "沒有行事曆";
							}else{
								echo $calendarEntry[0]->event_year . "年" . $calendarEntry[0]->event_month . "月" . $calendarEntry[0]->event_day . "日";
							}?>
						</td>
					</tr>
					<?php 
					}
					?>
				</table>
			</div>
		</div>
	</div>
	<?php require_once '/template/right-sidebar.phtml';?>
</div>